Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: emulator.get_debug_state response #271

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

szymonlesisz
Copy link
Contributor

@szymonlesisz szymonlesisz commented Oct 9, 2024

fixing problem 1:
get_debug_state tries to serialize non buffer fields/keys (1 indent missing)
edit: after further testing this change can be tricky.
DebugLinkState may contain some other filed types not only bytes (like int for example) but in the same time they might be complex and not serializable.
see thp state:

<DebugLinkState: {'mnemonic_secret': b'all all all all all all all all all all all all', 'passphrase_protection': False, 'reset_entropy': b'', 'mnemonic_type': <BackupType.Bip39: 0>, 'tokens': ['{', '"component"', ': ', '"SimplePage"', ', ', '"active_page"', ': ', '0', ', ', '"page_count"', ': ', '2', ', ', '"content"', ': ', '{', '"component"', ': ', '"AddressDetails"', ', ', '"qr_code"', ': ', '{', '"component"', ': ', '"Frame"', ', ', '"title"', ': ', '{', '"component"', ': ', '"Label"', ', ', '"text"', ': ', '"Scan QR code to pair"', '}', ', ', '"content"', ': ', '{', '"component"', ': ', '"Qr"', ', ', '"text"', ': ', '""', '}', ', ', '"button"', ': ', '{', '"component"', ': ', '"Button"', ', ', '"icon"', ': ', 'true', '}', '}', '}', '}'], 'thp_pairing_code_entry_code': 417041}>

fixing problem 2:
UI client assumes that dataObject.response is a string but in case of debug state it is an object

example: send JSON to server

{"type": "emulator-get-debug-state"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant